home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-11-19 | 2.4 KB | 89 lines | [TEXT/MPS ] |
- #
- # File: BuildExample
- #
- # Contains: Script to build one or more of the examples tools
- #
- # BuildExample [-a] [<example>…]
- #
- # <example> is the name of the example you want to build without
- # the trailing ".cp". More than one example may be given. For example:
- #
- # BuildExample TMethodNotifierExample TPriorityListExample
- #
- # The built tool will be placed in the ":Built" folder.
- #
- # If you use the -a options then all tools will be built.
- #
- # You must set the SLMInterfaces variable to the location of the folder
- # containing the SLM interface files and the SLMLibraries variable
- # to the location of the folder containing the SLM MPW libraries. You
- # can either set them in this script or set them in the shell and then
- # export them. The default is to look for them on a disk called
- # "Library Manager Developer".
- #
- # Copyright: © 1993 by Apple Computer, Inc., all rights reserved.
- #
- #
-
- # Set these next two variables to tell MPW where your
- # SLM Interfaces and Libraries are located.
-
- If "{SLMInterfaces}" == ""
- set SLMInterfaces "Library Manager Developer:Interfaces:"
- End
- If "{SLMLibraries}CFrontLibraries:" == ""
- set SLMLibraries "Library Manager Developer:Libraries:"
- End
-
- if NOT `Exists "{SLMInterfaces}"CIncludes:LibraryManager.h`
- Echo '## SLMInterfaces is not set properly!'
- Beep
- Exit 1
- end
- if NOT `Exists "{SLMLibraries}CFrontLibraries:"LibraryManager.o`
- Echo '## SLMLibraries is not set properly!'
- Beep
- Exit 1
- end
-
- set SRC ":Sources:"
- set OBJ ":Objects:"
- set BLT ":Built:"
-
- set doAll 0
- if "{1}" == "-a"
- set AllTools "`files -o "{SRC}"≈.cp`"
- SHIFT
- end
-
- for i in {Parameters} {AllTools}
- echo {i}
- if "{AllTools}" == ""
- Break if "{i}" == ""
- set name "{i}"
- else
- continue if NOT ("{i}" =~ /(≈:)«0,1»(≈)®1.cp/)
- set name {®1}
- end
-
- if NOT `Exists "{SRC}{name}".cp`
- Echo "## {name} is not a valid Example!"
- Beep
- Exit 1
- end
-
- echo "#### Building {name}"
- echo " Compiling ∂"{OBJ}{name}.cp.o∂""
- CPlus "{SRC}{name}".cp -o "{OBJ}{name}".cp.o -i "{SLMInterfaces}CIncludes" -mbg on -model far -sym on,nolines -mf -b2 -opt full -w1 -z15 -z17
- echo " Linking ∂"{BLT}{name}∂""
- Link -model far -w -d {LinkOptions} -o "{BLT}{name}" ∂
- -t 'MPST' -c 'MPS ' ∂
- "{CLibraries}CPlusLib.o" ∂
- "{SLMLibraries}CFrontLibraries:LibraryManager.o" ∂
- "{OBJ}{name}".cp.o ∂
- "{Libraries}ToolLibs.o" ∂
- "{Libraries}Runtime.o" ∂
- "{Libraries}Interface.o" ∂
- "{CLibraries}StdCLib.o"
- END
-